<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>查看帖子</title>
</head>
<body>
<iframe id="iframe" th:src="@{'/html/editor/viewPost.do?pid='+${pid}}" frameborder="0" width=1280 height=700 name="main" scrolling="no" onload="this.height=100"></iframe>
<script type="text/javascript">
    function reinitIframe(){
        var iframe = document.getElementById("iframe");
        try{
            var bHeight = iframe.contentWindow.document.body.scrollHeight;
            var dHeight = iframe.contentWindow.document.documentElement.scrollHeight;
            var height = Math.max(bHeight, dHeight);iframe.height = height;
            console.log(height);
        }catch (ex){}
    }window.setInterval("reinitIframe()", 200);
</script>
</body>
</html>